//
//  ZDBottomView.swift
//  1026SwiftSinaWeiBo
//
//  Created by Apple on 15/11/1.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit

class ZDBottomView: UIView {

    //MARK: 构造方法
    override init(frame: CGRect) {
        
        super.init(frame: frame)
        
        prepareUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    //MARK: 准备UI
    private func prepareUI() {
        
        backgroundColor = UIColor(white: 0.93, alpha: 1.0)
    
        //添加子控件
        addSubview(forwardButton)
        addSubview(commentButton)
        addSubview(likeButton)
        addSubview(leftSeparatView)
        addSubview(rightSeparatView)
        
        //添加约束
        //设置子控件平铺
        self.ff_HorizontalTile([forwardButton, commentButton, likeButton], insets: UIEdgeInsetsZero)
        
        //设置左边分割线的约束
        leftSeparatView.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: forwardButton, size: nil)
        
        //设置右边分割线的约束
        rightSeparatView.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: commentButton, size: nil)
        
    }
    
    
    
    
    //MARK: 懒加载
    private lazy var forwardButton: UIButton = UIButton(imageName: "timeline_icon_retweet", title: "转发")
    
    private lazy var commentButton: UIButton = UIButton(imageName: "timeline_icon_comment", title: "评论")
    
    private lazy var likeButton: UIButton = UIButton(imageName: "timeline_icon_unlike", title: "赞")
    
    private lazy var leftSeparatView: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    
    private lazy var rightSeparatView: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))

}
